package com.ctcnit.templatepro.global

import okhttp3.Interceptor
import okhttp3.Response

class HeaderInterceptor : Interceptor {
    private val TAG = this::class.java.simpleName
    override fun intercept(chain: Interceptor.Chain): Response {
//        val headers = setUpRequestHeaders()
//        val request = chain.request().newBuilder()
//            .addHeader("Content-Type", "application/json; charset=UTF-8")
//            .addHeader("Connection", "keep-alive")
//            .addHeader("token", headers["token"])
//            .addHeader("timestamp", headers["timestamp"])
//            .addHeader("sign", headers["sign"])
//            .build()
        return chain.proceed(chain.request().newBuilder().build())
    }

    /*private fun setUpRequestHeaders(): MutableMap<String, String> {
        val timestamp = System.currentTimeMillis().toString()
        val sb = StringBuilder()
        sb.append(token)//token
        sb.append(timestamp)//timestamp
        sb.append("{hotcity}")
        val sign = MD5Util.md5(sb.toString())
        return mutableMapOf("token" to token, "timestamp" to timestamp, "sign" to sign)
    }*/
}